﻿<%@ WebHandler Language="C#" Class="AjaxController" %>

using System;
using System.Web;
using DarkAjax.Utility;
public class AjaxController : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
    
    public void ProcessRequest (HttpContext context) {
        
        string className = context.Request["_class"];
        string _method = context.Request["_method"];
        if (!className.Equals("admin",StringComparison.OrdinalIgnoreCase) || !_method.Equals("login",StringComparison.OrdinalIgnoreCase) )
        {
            if (DarkBO.Admin.GetCookieAdmin().UserName.Length==0)
            {
                context.Response.Write("没有登录,或登录信息异常");
                context.Response.End();    
            }
            
        }
        switch (className.ToLower())
        {
            case "admin":
                jQueryAjaxUtility.RegisterAjaxInvokeEvent(typeof(DarkBO.Admin));
                break;
            case "production":
                jQueryAjaxUtility.RegisterAjaxInvokeEvent(typeof(DarkBO.Production));
                break;           
            default:
                break;
        }
        context.Response.Write("请提供_class");
    }
 
    public bool IsReusable {
        get {
            return true;
        }
    }

}